import 'package:flutter_test/flutter_test.dart';
import 'package:device_virtual_control/device_virtual_control.dart';
import 'package:device_virtual_control/device_virtual_control_platform_interface.dart';
import 'package:device_virtual_control/device_virtual_control_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockDeviceVirtualControlPlatform 
    with MockPlatformInterfaceMixin
    implements DeviceVirtualControlPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<bool> navigateToSystemHome() {
    // TODO: implement navigateToSystemHome
    throw UnimplementedError();
  }
}

void main() {
  final DeviceVirtualControlPlatform initialPlatform = DeviceVirtualControlPlatform.instance;

  test('$MethodChannelDeviceVirtualControl is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelDeviceVirtualControl>());
  });

  test('getPlatformVersion', () async {
    DeviceVirtualControl deviceVirtualControlPlugin = DeviceVirtualControl();
    MockDeviceVirtualControlPlatform fakePlatform = MockDeviceVirtualControlPlatform();
    DeviceVirtualControlPlatform.instance = fakePlatform;
  
    expect(await deviceVirtualControlPlugin.getPlatformVersion(), '42');
  });
}
